/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * DirectorView.java
 *
 * Created on 15.Eki.2010, 12:00:08
 */
package view.user;

import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.Iterator;
import java.util.Observable;
import java.util.Observer;
import javax.swing.DefaultComboBoxModel;
import javax.swing.DefaultListModel;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JLayeredPane;
import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.event.ListSelectionListener;
import model.Campaign;
import model.Client;
import model.user.Director;
import model.user.Staff;
import util.Utilization;

/**
 *
 * @author CUNEYT
 */
public class DirectorView extends javax.swing.JPanel implements Observer {

    /** Creates new form DirectorView */
    public DirectorView() {

        initComponents();
        initiateFields();
    }
    public static final String[] MONTHS = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        directorToolBar = new javax.swing.JToolBar();
        createCampaignButton = new javax.swing.JButton();
        listCampaignButton = new javax.swing.JButton();
        directorLayeredPane = new javax.swing.JLayeredPane();
        listPanel = new javax.swing.JPanel();
        campaignScrollPane = new javax.swing.JScrollPane();
        campaignList = new javax.swing.JList();
        campaignTitleLabel = new javax.swing.JLabel();
        campaignTitleTextField = new javax.swing.JTextField();
        campaignStatusLabel = new javax.swing.JLabel();
        statusComboBox = new javax.swing.JComboBox();
        campaignStartDateLabel = new javax.swing.JLabel();
        startDayComboBox = new javax.swing.JComboBox();
        startMonthComboBox = new javax.swing.JComboBox();
        startYearComboBox = new javax.swing.JComboBox();
        campaignEndDateLabel = new javax.swing.JLabel();
        endDayComboBox = new javax.swing.JComboBox();
        endMonthComboBox = new javax.swing.JComboBox();
        endYearComboBox = new javax.swing.JComboBox();
        campaignTypeLabel = new javax.swing.JLabel();
        campaignTypeTextField = new javax.swing.JTextField();
        staffScrollPane = new javax.swing.JScrollPane();
        staffList = new javax.swing.JList();
        staffLabel = new javax.swing.JLabel();
        staffCampaignsScrollPane = new javax.swing.JScrollPane();
        staffCampaignsList = new javax.swing.JList();
        staffCampaignsLabel = new javax.swing.JLabel();
        camResourceScrollPane = new javax.swing.JScrollPane();
        camResourceList = new javax.swing.JList();
        campaignResourceLabel = new javax.swing.JLabel();
        removeStaffButton = new javax.swing.JButton();
        addStaffButton = new javax.swing.JButton();
        staffToAssignScrollPane = new javax.swing.JScrollPane();
        staffToAssignList = new javax.swing.JList();
        staffToAssignLabel = new javax.swing.JLabel();
        campaignClientLabel = new javax.swing.JLabel();
        campaignClientTextField = new javax.swing.JTextField();
        updateClientInfoButton = new javax.swing.JButton();
        createPanel = new javax.swing.JPanel();
        cCampaignTitleLabel = new javax.swing.JLabel();
        cCampaignTypeLabel = new javax.swing.JLabel();
        cCampaignStartDateLabel = new javax.swing.JLabel();
        cCampaignEndDateLabel = new javax.swing.JLabel();
        cCampaignTitleTextField = new javax.swing.JTextField();
        cCampaignTypeComboBox = new javax.swing.JComboBox();
        ccStartDayComboBox = new javax.swing.JComboBox();
        ccStartMonthComboBox = new javax.swing.JComboBox();
        ccStartYearComboBox = new javax.swing.JComboBox();
        ccEndDayComboBox = new javax.swing.JComboBox();
        ccEndMonthComboBox = new javax.swing.JComboBox();
        ccEndYearComboBox = new javax.swing.JComboBox();
        ccClientLabel = new javax.swing.JLabel();
        ccClientComboBox = new javax.swing.JComboBox();
        ccCreateClientButton = new javax.swing.JButton();
        ccResourceLabel = new javax.swing.JLabel();
        resourceScrollPane = new javax.swing.JScrollPane();
        resourceList = new javax.swing.JList();
        resourceAmountLabel = new javax.swing.JLabel();
        resourceAmountTextField = new javax.swing.JTextField();
        resourceAddButton = new javax.swing.JButton();
        campaignResourceScrollPane = new javax.swing.JScrollPane();
        campaignResourceList = new javax.swing.JList();
        removeCampaignResourceButton = new javax.swing.JButton();
        jSeparator1 = new javax.swing.JSeparator();
        resetButton = new javax.swing.JButton();
        negotiateButton = new javax.swing.JButton();

        directorToolBar.setBorder(null);
        directorToolBar.setFloatable(false);
        directorToolBar.setRollover(true);
        directorToolBar.setBorderPainted(false);

        createCampaignButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/add.png"))); // NOI18N
        createCampaignButton.setText("CREATE");
        createCampaignButton.setFocusable(false);
        createCampaignButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        createCampaignButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        directorToolBar.add(createCampaignButton);

        listCampaignButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/list.png"))); // NOI18N
        listCampaignButton.setText("LIST");
        listCampaignButton.setFocusable(false);
        listCampaignButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        listCampaignButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        directorToolBar.add(listCampaignButton);

        campaignList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_INTERVAL_SELECTION);
        campaignList.setVisibleRowCount(-1);
        campaignScrollPane.setViewportView(campaignList);

        campaignTitleLabel.setText("Title");

        campaignTitleTextField.setEditable(false);

        campaignStatusLabel.setText("Status");

        campaignStartDateLabel.setText("Start Date");

        startDayComboBox.setModel(new DefaultComboBoxModel());

        campaignEndDateLabel.setText("End Date");

        campaignTypeLabel.setText("Type");

        campaignTypeTextField.setEditable(false);

        staffList.setModel(new DefaultListModel());
        staffList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
        staffList.setVisibleRowCount(-1);
        staffScrollPane.setViewportView(staffList);

        staffLabel.setText("STAFF INVOLVED IN THE CAMPAIGN");

        staffCampaignsList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
        staffCampaignsList.setVisibleRowCount(-1);
        staffCampaignsScrollPane.setViewportView(staffCampaignsList);

        staffCampaignsLabel.setText("CAMPAIGNS OF THE SELECTED STAFF");

        camResourceList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
        camResourceScrollPane.setViewportView(camResourceList);

        campaignResourceLabel.setText("RESOURCES OF THE SELECTED CAMPAIGN");

        removeStaffButton.setText("REMOVE");
        removeStaffButton.setEnabled(false);

        addStaffButton.setText("ADD");
        addStaffButton.setEnabled(false);

        staffToAssignList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
        staffToAssignScrollPane.setViewportView(staffToAssignList);

        staffToAssignLabel.setText("STAFF TO ASSIGN");

        campaignClientLabel.setText("Client");

        campaignClientTextField.setEditable(false);

        updateClientInfoButton.setText("UPDATE");

        javax.swing.GroupLayout listPanelLayout = new javax.swing.GroupLayout(listPanel);
        listPanel.setLayout(listPanelLayout);
        listPanelLayout.setHorizontalGroup(
            listPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(listPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(campaignScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 206, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(listPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(listPanelLayout.createSequentialGroup()
                        .addGroup(listPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(campaignStartDateLabel)
                            .addComponent(campaignStatusLabel)
                            .addComponent(campaignTitleLabel))
                        .addGap(22, 22, 22)
                        .addGroup(listPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addGroup(listPanelLayout.createSequentialGroup()
                                .addGroup(listPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                    .addComponent(statusComboBox, javax.swing.GroupLayout.Alignment.LEADING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, listPanelLayout.createSequentialGroup()
                                        .addComponent(startDayComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(18, 18, 18)
                                        .addComponent(startMonthComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                .addGap(18, 18, 18)
                                .addComponent(startYearComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(campaignTitleTextField))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 94, Short.MAX_VALUE))
                    .addGroup(listPanelLayout.createSequentialGroup()
                        .addGroup(listPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(staffCampaignsScrollPane, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 200, Short.MAX_VALUE)
                            .addComponent(staffCampaignsLabel, javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(staffLabel, javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(staffScrollPane, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 200, Short.MAX_VALUE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(listPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(removeStaffButton)
                            .addComponent(addStaffButton))
                        .addGap(7, 7, 7)))
                .addGroup(listPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(listPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(listPanelLayout.createSequentialGroup()
                            .addGroup(listPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(staffToAssignScrollPane, 0, 0, Short.MAX_VALUE)
                                .addGroup(listPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addGroup(listPanelLayout.createSequentialGroup()
                                        .addGroup(listPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                            .addGroup(listPanelLayout.createSequentialGroup()
                                                .addComponent(campaignTypeLabel)
                                                .addGap(24, 24, 24))
                                            .addGroup(listPanelLayout.createSequentialGroup()
                                                .addComponent(campaignEndDateLabel)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)))
                                        .addGroup(listPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                            .addComponent(campaignTypeTextField, javax.swing.GroupLayout.Alignment.LEADING)
                                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, listPanelLayout.createSequentialGroup()
                                                .addComponent(endDayComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addGap(18, 18, 18)
                                                .addComponent(endMonthComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addGap(18, 18, 18)
                                                .addComponent(endYearComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                            .addComponent(campaignClientTextField, javax.swing.GroupLayout.Alignment.LEADING))
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(updateClientInfoButton))
                                    .addComponent(campaignResourceLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(camResourceScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 215, Short.MAX_VALUE)))
                            .addGap(240, 240, 240))
                        .addGroup(listPanelLayout.createSequentialGroup()
                            .addComponent(staffToAssignLabel)
                            .addContainerGap()))
                    .addGroup(listPanelLayout.createSequentialGroup()
                        .addComponent(campaignClientLabel)
                        .addContainerGap())))
        );
        listPanelLayout.setVerticalGroup(
            listPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(listPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(listPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(campaignScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 438, Short.MAX_VALUE)
                    .addGroup(listPanelLayout.createSequentialGroup()
                        .addGap(3, 3, 3)
                        .addGroup(listPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(listPanelLayout.createSequentialGroup()
                                .addGroup(listPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(campaignTitleTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(campaignTitleLabel))
                                .addGap(10, 10, 10)
                                .addGroup(listPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addGroup(listPanelLayout.createSequentialGroup()
                                        .addGroup(listPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(campaignStatusLabel)
                                            .addComponent(statusComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addGroup(listPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(campaignStartDateLabel)
                                            .addComponent(startDayComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                    .addGroup(listPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                        .addComponent(startMonthComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(startYearComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                            .addGroup(listPanelLayout.createSequentialGroup()
                                .addGroup(listPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(campaignClientLabel)
                                    .addComponent(campaignClientTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(updateClientInfoButton))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addGroup(listPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(campaignTypeTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(campaignTypeLabel))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(listPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(endDayComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(endMonthComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(endYearComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(campaignEndDateLabel))))
                        .addGroup(listPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(listPanelLayout.createSequentialGroup()
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(staffLabel)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                            .addGroup(listPanelLayout.createSequentialGroup()
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(staffToAssignLabel)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)))
                        .addGroup(listPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addGroup(listPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(staffScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 137, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGroup(listPanelLayout.createSequentialGroup()
                                    .addComponent(removeStaffButton)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(addStaffButton)))
                            .addComponent(staffToAssignScrollPane))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(listPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(listPanelLayout.createSequentialGroup()
                                .addComponent(staffCampaignsLabel)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(staffCampaignsScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 156, Short.MAX_VALUE))
                            .addGroup(listPanelLayout.createSequentialGroup()
                                .addComponent(campaignResourceLabel)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(camResourceScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 151, Short.MAX_VALUE)))))
                .addContainerGap())
        );

        listPanel.setBounds(0, 0, 970, 460);
        directorLayeredPane.add(listPanel, javax.swing.JLayeredPane.DEFAULT_LAYER);

        cCampaignTitleLabel.setText("Title");

        cCampaignTypeLabel.setText("Type");

        cCampaignStartDateLabel.setText("Start Date");

        cCampaignEndDateLabel.setText("End Date");

        ccClientLabel.setText("Client");

        ccCreateClientButton.setText("Create New");

        ccResourceLabel.setText("Resources");

        resourceList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
        resourceList.setVisibleRowCount(-1);
        resourceScrollPane.setViewportView(resourceList);

        resourceAmountLabel.setText("Amount");

        resourceAddButton.setText("ADD");
        resourceAddButton.setEnabled(false);

        campaignResourceList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
        campaignResourceList.setVisibleRowCount(-1);
        campaignResourceScrollPane.setViewportView(campaignResourceList);

        removeCampaignResourceButton.setText("REMOVE");
        removeCampaignResourceButton.setEnabled(false);

        resetButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/delete.png"))); // NOI18N
        resetButton.setText("RESET");

        negotiateButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/tick.png"))); // NOI18N
        negotiateButton.setText("NEGOTIATE");

        javax.swing.GroupLayout createPanelLayout = new javax.swing.GroupLayout(createPanel);
        createPanel.setLayout(createPanelLayout);
        createPanelLayout.setHorizontalGroup(
            createPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, createPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(createPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(createPanelLayout.createSequentialGroup()
                        .addComponent(negotiateButton)
                        .addGap(18, 18, 18)
                        .addComponent(resetButton))
                    .addComponent(jSeparator1, javax.swing.GroupLayout.DEFAULT_SIZE, 394, Short.MAX_VALUE)
                    .addGroup(createPanelLayout.createSequentialGroup()
                        .addGroup(createPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, createPanelLayout.createSequentialGroup()
                                .addComponent(cCampaignTitleLabel)
                                .addGap(48, 48, 48)
                                .addComponent(cCampaignTitleTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 120, Short.MAX_VALUE))
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, createPanelLayout.createSequentialGroup()
                                .addComponent(ccResourceLabel)
                                .addGap(18, 18, 18)
                                .addComponent(resourceScrollPane, 0, 0, Short.MAX_VALUE))
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, createPanelLayout.createSequentialGroup()
                                .addGroup(createPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(cCampaignStartDateLabel)
                                    .addComponent(ccClientLabel))
                                .addGap(18, 18, 18)
                                .addGroup(createPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addGroup(createPanelLayout.createSequentialGroup()
                                        .addComponent(ccStartDayComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(18, 18, 18)
                                        .addComponent(ccStartMonthComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(18, 18, 18)
                                        .addComponent(ccStartYearComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addComponent(ccClientComboBox, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
                        .addGroup(createPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(createPanelLayout.createSequentialGroup()
                                .addGroup(createPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(createPanelLayout.createSequentialGroup()
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addGroup(createPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                            .addComponent(resourceAddButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addComponent(resourceAmountTextField)
                                            .addComponent(removeCampaignResourceButton)))
                                    .addGroup(createPanelLayout.createSequentialGroup()
                                        .addGap(10, 10, 10)
                                        .addComponent(resourceAmountLabel)))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(campaignResourceScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 121, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(createPanelLayout.createSequentialGroup()
                                .addGap(18, 18, 18)
                                .addGroup(createPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(createPanelLayout.createSequentialGroup()
                                        .addGroup(createPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(cCampaignEndDateLabel)
                                            .addComponent(cCampaignTypeLabel))
                                        .addGap(24, 24, 24)
                                        .addGroup(createPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                            .addGroup(createPanelLayout.createSequentialGroup()
                                                .addComponent(ccEndDayComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addGap(18, 18, 18)
                                                .addComponent(ccEndMonthComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addGap(18, 18, 18)
                                                .addComponent(ccEndYearComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                            .addComponent(cCampaignTypeComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                    .addComponent(ccCreateClientButton))))))
                .addGap(566, 566, 566))
        );
        createPanelLayout.setVerticalGroup(
            createPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(createPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(createPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(createPanelLayout.createSequentialGroup()
                        .addGroup(createPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(cCampaignTitleLabel)
                            .addComponent(cCampaignTitleTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(18, 18, 18)
                        .addGroup(createPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(cCampaignStartDateLabel)
                            .addComponent(ccStartDayComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(ccStartMonthComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(ccStartYearComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(18, 18, 18)
                        .addGroup(createPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(ccClientLabel)
                            .addComponent(ccClientComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(createPanelLayout.createSequentialGroup()
                        .addGroup(createPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(cCampaignTypeLabel)
                            .addComponent(cCampaignTypeComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(18, 18, 18)
                        .addGroup(createPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(ccEndDayComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(cCampaignEndDateLabel)
                            .addComponent(ccEndMonthComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(ccEndYearComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(18, 18, 18)
                        .addComponent(ccCreateClientButton)))
                .addGap(18, 18, 18)
                .addGroup(createPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(campaignResourceScrollPane)
                    .addComponent(ccResourceLabel)
                    .addComponent(resourceScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 109, Short.MAX_VALUE)
                    .addGroup(createPanelLayout.createSequentialGroup()
                        .addComponent(resourceAmountLabel)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(resourceAmountTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(resourceAddButton)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(removeCampaignResourceButton)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(createPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(resetButton)
                    .addComponent(negotiateButton))
                .addContainerGap(168, Short.MAX_VALUE))
        );

        createPanel.setBounds(0, 0, 970, 460);
        directorLayeredPane.add(createPanel, javax.swing.JLayeredPane.DEFAULT_LAYER);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(directorLayeredPane, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 982, Short.MAX_VALUE)
                    .addComponent(directorToolBar, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 982, Short.MAX_VALUE))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(directorToolBar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(directorLayeredPane, javax.swing.GroupLayout.DEFAULT_SIZE, 473, Short.MAX_VALUE)
                .addContainerGap())
        );
    }// </editor-fold>//GEN-END:initComponents

    public void update(Observable o, Object arg) {

        if (arg instanceof Director) {
            Director d = (Director) arg;
            getCampaignList().setModel(new ACIListModel(d.getCampaigns()));
        }

    }

    public void addResetButtonListener(ActionListener l) {
        resetButton.addActionListener(l);
    }

    public void addNegotiateButtonListener(ActionListener k) {
        negotiateButton.addActionListener(k);
    }

    public JButton getNegotiateButton() {
        return negotiateButton;
    }

    public void setNegotiateButton(JButton negotiateButton) {
        this.negotiateButton = negotiateButton;
    }

    public JButton getResetButton() {
        return resetButton;
    }

    public void setResetButton(JButton resetButton) {
        this.resetButton = resetButton;
    }

    public JTextField getcCampaignTitleTextField() {
        return cCampaignTitleTextField;
    }

    public void setcCampaignTitleTextField(JTextField cCampaignTitleTextField) {
        this.cCampaignTitleTextField = cCampaignTitleTextField;
    }

    public JComboBox getcCampaignTypeComboBox() {
        return cCampaignTypeComboBox;
    }

    public void setcCampaignTypeComboBox(JComboBox cCampaignTypeComboBox) {
        this.cCampaignTypeComboBox = cCampaignTypeComboBox;
    }

    public JComboBox getCcClientComboBox() {
        return ccClientComboBox;
    }

    public void setCcClientComboBox(JComboBox ccClientComboBox) {
        this.ccClientComboBox = ccClientComboBox;
    }

    public JButton getCcCreateClientButton() {
        return ccCreateClientButton;
    }

    public void setCcCreateClientButton(JButton ccCreateClientButton) {
        this.ccCreateClientButton = ccCreateClientButton;
    }

    public JComboBox getCcEndDayComboBox() {
        return ccEndDayComboBox;
    }

    public void setCcEndDayComboBox(JComboBox ccEndDayComboBox) {
        this.ccEndDayComboBox = ccEndDayComboBox;
    }

    public JComboBox getCcEndMonthComboBox() {
        return ccEndMonthComboBox;
    }

    public void setCcEndMonthComboBox(JComboBox ccEndMonthComboBox) {
        this.ccEndMonthComboBox = ccEndMonthComboBox;
    }

    public JComboBox getCcEndYearComboBox() {
        return ccEndYearComboBox;
    }

    public void setCcEndYearComboBox(JComboBox ccEndYearComboBox) {
        this.ccEndYearComboBox = ccEndYearComboBox;
    }

    public JComboBox getCcStartDayComboBox() {
        return ccStartDayComboBox;
    }

    public void setCcStartDayComboBox(JComboBox ccStartDayComboBox) {
        this.ccStartDayComboBox = ccStartDayComboBox;
    }

    public JComboBox getCcStartMonthComboBox() {
        return ccStartMonthComboBox;
    }

    public void setCcStartMonthComboBox(JComboBox ccStartMonthComboBox) {
        this.ccStartMonthComboBox = ccStartMonthComboBox;
    }

    public JComboBox getCcStartYearComboBox() {
        return ccStartYearComboBox;
    }

    public void setCcStartYearComboBox(JComboBox ccStartYearComboBox) {
        this.ccStartYearComboBox = ccStartYearComboBox;
    }

    public JList getStaffCampaignsList() {
        return staffCampaignsList;
    }

    public void setStaffCampaignsList(JList staffCampaignsList) {
        this.staffCampaignsList = staffCampaignsList;
    }

    public void addCampaignListSelectionListener(ListSelectionListener lsl) {
        campaignList.addListSelectionListener(lsl);
    }

    public void addStaffListSelectionListener(ListSelectionListener lsl) {
        staffList.addListSelectionListener(lsl);
    }

    public void addListCampaignButtonListener(ActionListener l) {
        listCampaignButton.addActionListener(l);
    }

    public void addCreateCampaignButtonListener(ActionListener l) {
        createCampaignButton.addActionListener(l);
    }

    public void addCreateClientButtonListener(ActionListener l) {
        ccCreateClientButton.addActionListener(l);
    }

    public JLayeredPane getDirectorLayeredPane() {
        return directorLayeredPane;
    }

    public void setDirectorLayeredPane(JLayeredPane directorLayeredPane) {
        this.directorLayeredPane = directorLayeredPane;
    }

    public JPanel getCreatePanel() {
        return createPanel;
    }

    public void setCreatePanel(JPanel createPanel) {
        this.createPanel = createPanel;
    }

    public JList getCampaignList() {
        return campaignList;
    }

    public void setCampaignList(JList campaignList) {
        this.campaignList = campaignList;
    }

    public JTextField getCampaignTitleTextField() {
        return campaignTitleTextField;
    }

    public void setCampaignTitleTextField(JTextField campaignTitleTextField) {
        this.campaignTitleTextField = campaignTitleTextField;
    }

    public JTextField getCampaignTypeTextField() {
        return campaignTypeTextField;
    }

    public void setCampaignTypeTextField(JTextField campaignTypeTextField) {
        this.campaignTypeTextField = campaignTypeTextField;
    }

    public JButton getCreateCampaignButton() {
        return createCampaignButton;
    }

    public void setCreateCampaignButton(JButton createCampaignButton) {
        this.createCampaignButton = createCampaignButton;
    }

    public JComboBox getEndDayComboBox() {
        return endDayComboBox;
    }

    public void setEndDayComboBox(JComboBox endDayComboBox) {
        this.endDayComboBox = endDayComboBox;
    }

    public JComboBox getEndMonthComboBox() {
        return endMonthComboBox;
    }

    public void setEndMonthComboBox(JComboBox endMonthComboBox) {
        this.endMonthComboBox = endMonthComboBox;
    }

    public JComboBox getEndYearComboBox() {
        return endYearComboBox;
    }

    public void setEndYearComboBox(JComboBox endYearComboBox) {
        this.endYearComboBox = endYearComboBox;
    }

    public JButton getListCampaignButton() {
        return listCampaignButton;
    }

    public void setListCampaignButton(JButton listCampaignButton) {
        this.listCampaignButton = listCampaignButton;
    }

    public JPanel getListPanel() {
        return listPanel;
    }

    public void setListPanel(JPanel listPanel) {
        this.listPanel = listPanel;
    }

    public JList getStaffList() {
        return staffList;
    }

    public void setStaffList(JList staffList) {
        this.staffList = staffList;
    }

    public JComboBox getStartDayComboBox() {
        return startDayComboBox;
    }

    public void setStartDayComboBox(JComboBox startDayComboBox) {
        this.startDayComboBox = startDayComboBox;
    }

    public JComboBox getStartMonthComboBox() {
        return startMonthComboBox;
    }

    public void setStartMonthComboBox(JComboBox startMonthComboBox) {
        this.startMonthComboBox = startMonthComboBox;
    }

    public JComboBox getStartYearComboBox() {
        return startYearComboBox;
    }

    public void setStartYearComboBox(JComboBox startYearComboBox) {
        this.startYearComboBox = startYearComboBox;
    }

    public JComboBox getStatusComboBox() {
        return statusComboBox;
    }

    public void setStatusComboBox(JComboBox statusComboBox) {
        this.statusComboBox = statusComboBox;
    }

    public void updateStaffFields(Staff s) {
        if ((s != null) && (s.getCampaigns() != null)) {
            staffCampaignsList.setModel(new ACIListModel(s.getCampaigns()));
        } else {
            staffCampaignsList.setModel(new DefaultListModel());
        }
    }

    public JButton getAddStaffButton() {
        return addStaffButton;
    }

    public JButton getRemoveStaffButton() {
        return removeStaffButton;
    }

    public JList getCampaignResourceList() {
        return campaignResourceList;
    }

    public JButton getRemoveCampaignResourceButton() {
        return removeCampaignResourceButton;
    }

    public JButton getResourceAddButton() {
        return resourceAddButton;
    }

    public JTextField getResourceAmountTextField() {
        return resourceAmountTextField;
    }

    public JList getResourceList() {
        return resourceList;
    }

    public JList getCamResourceList() {
        return camResourceList;
    }

    public JList getStaffToAssignList() {
        return staffToAssignList;
    }

    public JTextField getCampaignClientTextField() {
        return campaignClientTextField;
    }

    public JButton getUpdateClientInfoButton() {
        return updateClientInfoButton;
    }

    public void updateCampaignFields(Campaign c) {
        if (c != null) {
            Object[] start = parseDate(c.getStartDate().toString());
            Object[] end = parseDate(c.getEndDate().toString());

            getCampaignTitleTextField().setText(c.getTitle());
            getCampaignTypeTextField().setText(c.getType());
            getStatusComboBox().setSelectedItem(c.getStatus());
            getStartDayComboBox().setSelectedIndex(Integer.parseInt(start[0].toString()) - 1);
            getStartMonthComboBox().setSelectedItem(start[1]);
            getStartYearComboBox().setSelectedItem(Integer.parseInt(start[2].toString()));
            getEndDayComboBox().setSelectedIndex(Integer.parseInt(end[0].toString()) - 1);
            getEndMonthComboBox().setSelectedItem(end[1]);
            getEndYearComboBox().setSelectedItem(Integer.parseInt(end[2].toString()));
            getStaffList().setModel(new ACIListModel(c.getStaff()));
            getCamResourceList().setModel(new ACIListModel(c.getResources()));
            if (c.getClient() != null) {
                getCampaignClientTextField().setText(c.getClient().toString());
            } else {
                getCampaignClientTextField().setText("");
            }
        } else {
            getCampaignClientTextField().setText("");
            getStaffList().setModel(new DefaultListModel());
            getCamResourceList().setModel(new DefaultListModel());
            getAddStaffButton().setEnabled(false);
        }
    }

    public static Object[] parseDate(String date) {
        Object[] result = new Object[3];
        result[0] = date.substring(8, 10);
        result[1] = date.substring(4, 7);
        result[2] = date.substring(date.length() - 4, date.length());
        return result;
    }

    public void initiateClients() {
        ArrayList<Client> clients = Utilization.getClients();
        ccClientComboBox.removeAllItems();
        for (Iterator<Client> it = clients.iterator(); it.hasNext();) {
            Client client = it.next();
            ccClientComboBox.addItem(client);
        }
    }

    public void initiateStatus() {
        statusComboBox.addItem(Campaign.ACTIVE);
        statusComboBox.addItem(Campaign.NEGOTIATION);
        statusComboBox.addItem(Campaign.ARCHIVE);
    }

    public void initiateCampaignTypes() {
        cCampaignTypeComboBox.addItem(Campaign.INTERNET);
        cCampaignTypeComboBox.addItem(Campaign.MAGAZINE_NEWSPAPER);
        cCampaignTypeComboBox.addItem(Campaign.TV);
        cCampaignTypeComboBox.addItem(Campaign.RADIO);
        cCampaignTypeComboBox.addItem(Campaign.LEAFLET);

    }

    public void initiateDates() {
        Calendar stCal = new GregorianCalendar();

        for (int i = 1; i < 32; i++) {
            startDayComboBox.addItem(i);
            endDayComboBox.addItem(i);
            ccStartDayComboBox.addItem(i);
            ccEndDayComboBox.addItem(i);
        }

        ccStartDayComboBox.setSelectedItem(stCal.get(Calendar.DAY_OF_MONTH));
        ccEndDayComboBox.setSelectedItem(stCal.get(Calendar.DAY_OF_MONTH));

        for (int i = 0; i < 12; i++) {
            startMonthComboBox.addItem(MONTHS[i]);
            endMonthComboBox.addItem(MONTHS[i]);
            ccStartMonthComboBox.addItem(MONTHS[i]);
            ccEndMonthComboBox.addItem(MONTHS[i]);
        }
        ccStartMonthComboBox.setSelectedIndex(stCal.get(Calendar.MONTH));
        ccEndMonthComboBox.setSelectedIndex(stCal.get(Calendar.MONTH));

        for (int i = stCal.get(Calendar.YEAR) - 5; i <= stCal.get(Calendar.YEAR) + 5; i++) {
            startYearComboBox.addItem(i);
            endYearComboBox.addItem(i);
            if (i >= stCal.get(Calendar.YEAR)) {
                ccStartYearComboBox.addItem(i);
            }
            ccEndYearComboBox.addItem(i);
        }
        ccStartYearComboBox.setSelectedItem(stCal.get(Calendar.YEAR));
        ccEndYearComboBox.setSelectedItem((stCal.get(Calendar.YEAR)) + 1);
    }

    private void initiateFields() {
        initiateDates();
        initiateStatus();
        initiateCampaignTypes();
        initiateClients();

    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton addStaffButton;
    private javax.swing.JLabel cCampaignEndDateLabel;
    private javax.swing.JLabel cCampaignStartDateLabel;
    private javax.swing.JLabel cCampaignTitleLabel;
    private javax.swing.JTextField cCampaignTitleTextField;
    private javax.swing.JComboBox cCampaignTypeComboBox;
    private javax.swing.JLabel cCampaignTypeLabel;
    private javax.swing.JList camResourceList;
    private javax.swing.JScrollPane camResourceScrollPane;
    private javax.swing.JLabel campaignClientLabel;
    private javax.swing.JTextField campaignClientTextField;
    private javax.swing.JLabel campaignEndDateLabel;
    private javax.swing.JList campaignList;
    private javax.swing.JLabel campaignResourceLabel;
    private javax.swing.JList campaignResourceList;
    private javax.swing.JScrollPane campaignResourceScrollPane;
    private javax.swing.JScrollPane campaignScrollPane;
    private javax.swing.JLabel campaignStartDateLabel;
    private javax.swing.JLabel campaignStatusLabel;
    private javax.swing.JLabel campaignTitleLabel;
    private javax.swing.JTextField campaignTitleTextField;
    private javax.swing.JLabel campaignTypeLabel;
    private javax.swing.JTextField campaignTypeTextField;
    private javax.swing.JComboBox ccClientComboBox;
    private javax.swing.JLabel ccClientLabel;
    private javax.swing.JButton ccCreateClientButton;
    private javax.swing.JComboBox ccEndDayComboBox;
    private javax.swing.JComboBox ccEndMonthComboBox;
    private javax.swing.JComboBox ccEndYearComboBox;
    private javax.swing.JLabel ccResourceLabel;
    private javax.swing.JComboBox ccStartDayComboBox;
    private javax.swing.JComboBox ccStartMonthComboBox;
    private javax.swing.JComboBox ccStartYearComboBox;
    private javax.swing.JButton createCampaignButton;
    private javax.swing.JPanel createPanel;
    private javax.swing.JLayeredPane directorLayeredPane;
    private javax.swing.JToolBar directorToolBar;
    private javax.swing.JComboBox endDayComboBox;
    private javax.swing.JComboBox endMonthComboBox;
    private javax.swing.JComboBox endYearComboBox;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JButton listCampaignButton;
    private javax.swing.JPanel listPanel;
    private javax.swing.JButton negotiateButton;
    private javax.swing.JButton removeCampaignResourceButton;
    private javax.swing.JButton removeStaffButton;
    private javax.swing.JButton resetButton;
    private javax.swing.JButton resourceAddButton;
    private javax.swing.JLabel resourceAmountLabel;
    private javax.swing.JTextField resourceAmountTextField;
    private javax.swing.JList resourceList;
    private javax.swing.JScrollPane resourceScrollPane;
    private javax.swing.JLabel staffCampaignsLabel;
    private javax.swing.JList staffCampaignsList;
    private javax.swing.JScrollPane staffCampaignsScrollPane;
    private javax.swing.JLabel staffLabel;
    private javax.swing.JList staffList;
    private javax.swing.JScrollPane staffScrollPane;
    private javax.swing.JLabel staffToAssignLabel;
    private javax.swing.JList staffToAssignList;
    private javax.swing.JScrollPane staffToAssignScrollPane;
    private javax.swing.JComboBox startDayComboBox;
    private javax.swing.JComboBox startMonthComboBox;
    private javax.swing.JComboBox startYearComboBox;
    private javax.swing.JComboBox statusComboBox;
    private javax.swing.JButton updateClientInfoButton;
    // End of variables declaration//GEN-END:variables
}
